from Common.basepage import BasePage
from PageLocators.MainPage_locator import MainPageLocator as loc
import re
from Common.handle_log import do_log
import time
from Common.connect_to_device import d  # 全局驱动 d 重要，勿删！


class MainPage(BasePage):

    def click_start_share(self):
        self.click_element(loc.start_share_loc, "主页_点击开始分享")

    def select_two_secren(self):
        self.click_element(loc.sec_screen, "选择副驾屏")
        self.click_element(loc.third_screen, "选择后排屏")

    def click_ok_share(self):
        self.click_element(loc.ok_loc, "开始投屏")


if __name__ == '__main__':
    # MainPage().move_focus_to_item("应用")
    MainPage().click_start_share()
    time.sleep(1)
    MainPage().select_two_secren()
    time.sleep(1)
    MainPage().click_ok_share()
